Skip to content

fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple ssm parameters. #3241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

sean-hernon
Copy link
Contributor

@sean-hernon sean-hernon commented Oct 23, 2023

When getting multiple ssm parameters by path, the POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable should be respected as to whether to automatically decrypt the values, as is with the single get.

Issue number: 3240

Summary

Check the value of the POWERTOOLS_PARAMETERS_SSM_DECRYPT and respect that when deciding
whether to decrypt multiple parameters that were loaded.

Changes

The get_multiple method of the ssm provider will check the value of the environment variable, when deciding
whether to decrypt. The default remains false for the case where none exists, or no explicit parameter is passed.

User experience

The user can get multiple parameters, decrypted, by setting the environment variable.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@sean-hernon sean-hernon requested a review from a team October 23, 2023 14:33
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 23, 2023
@boring-cyborg boring-cyborg bot added the tests label Oct 23, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 23, 2023

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@sean-hernon sean-hernon changed the title Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. fix(parameters) Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. Oct 23, 2023
@sean-hernon sean-hernon changed the title fix(parameters) Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. Oct 23, 2023
@leandrodamascena leandrodamascena changed the title fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. Oct 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (115e666) 95.96% compared to head (9b17331) 95.97%.
Report is 2 commits behind head on develop.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3241   +/-   ##
========================================
  Coverage    95.96%   95.97%           
========================================
  Files          195      195           
  Lines         8387     8388    +1     
  Branches      1563     1563           
========================================
+ Hits          8049     8050    +1     
  Misses         276      276           
  Partials        62       62           
Files Coverage Δ
aws_lambda_powertools/utilities/parameters/ssm.py 97.60% <100.00%> (+0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

… getting multiple parameters.

When getting multiple ssm parameters by path, the `POWERTOOLS_PARAMETERS_SSM_DECRYPT`
environment variable should be respected as to whether to automatically decrypt the
values, as is with the single `get`.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sean-hernon! I left a comment to change this PR.

@leandrodamascena leandrodamascena added the parameters Parameters utility label Oct 25, 2023
@leandrodamascena leandrodamascena self-requested a review October 25, 2023 13:37
@leandrodamascena leandrodamascena changed the title fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple parameters. fix(parameters): Respect POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable when getting multiple ssm parameters. Oct 25, 2023
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@leandrodamascena leandrodamascena merged commit c134086 into aws-powertools:develop Oct 25, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 25, 2023

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@sean-hernon
Copy link
Contributor Author

LGTM!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameters Parameters utility size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: POWERTOOLS_PARAMETERS_SSM_DECRYPT environment variable not respected for get multiple
3 participants